<script lang="ts" setup>

const props = defineProps<{
    data: Array<any>,
}>()


</script>

<template>
<div class="color-table">
  <div v-for="colors in data" class="colors">
    <div v-for="(item, index) in colors" class="color" :style="{background: `rgb(${item.value})`, color:index>=5 || item.name==='black' ? 'white' : 'black'}">
      <div class="name">{{item.name}}</div>
      <div class="value">{{item.value}}</div>
    </div>
  </div>
</div>
</template>

<style scoped>
.color-table{
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  .colors{
    .color{
      padding: 5px;
      .name{
        font-size: 12px;
        font-weight: 700;
      }
      .value{
        font-size: 14px;
        text-align: right;
      }
    }
  }
}
</style>